package design_pattern;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/10 11:32
 * @Version 1.0
 */
public class Test2 {
    public static void doErrorHandle() {
        Boolean a = false;
        Integer b = 5;
        System.out.println("outSide-before a- hashcode"+a.hashCode()+"   b-hashCode"+b.hashCode());
        passBaseValue(a, b);
        System.out.println("outSide-after a- hashcode"+a.hashCode()+"   b-hashCode"+b.hashCode());
        if (a == true || b == 10) {
            System.out.println("Execute Something");
        } else {
            System.out.println("param result wrong");
        }
    }

    public static void passBaseValue(Boolean flg, Integer num) {
        System.out.println("inside-before: a- hashcode"+flg.hashCode()+"   b-hashCode"+num.hashCode());
        flg = true;
        num = 10;
        System.out.println("inside-after: a- hashcode"+flg.hashCode()+"   b-hashCode"+num.hashCode());
    }

    public static void main(String[] args) {
        doErrorHandle();
    }
}
